package bookstore.dao.impl;



import bookstore.dao.BaseDao;
import bookstore.dao.PorductDao;
import bookstore.entity.Product;

import java.util.List;

/**
 * @author 苗庆
 * @version 1.0
 */
public class PorductDaoImpl extends BaseDao implements PorductDao {

    /***
     *
     * @return
     */
    @Override
    public List<Product> queryAll() {
        return null;
    }

    /***
     * 苗庆
     * 添加商品信息
     * @param product 商品对象
     * @return   返回值为-1表示失败
     */
    @Override
    public int insert(Product product) {
        String sql = "INSERT INTO `T_product` (`name`, `price`, `category`, `pnum`, `imgurl`, `description`) VALUES (?, ?, ?, ?,?,?)";
        return super.update(sql,product.getName(),product.getPrice(),product.getCategory(),product.getpNum(),product.getImgUrl(),product.getDescription());
    }

    /**
     *
     * @param product  商品对象
     * @return
     */
       @Override
    public int update(Product product) {
        return 0;
    }

    /**
     *
     * @param product 商品ID
     * @return
     */
    @Override
    public int delete(Product product) {
        return 0;
    }

    /**
     *
     * @param product 用户ID
     * @return
     */
    @Override
    public Product queryById(Product product) {
        return null;
    }
}
